<template>
	<div class="detail-choose-tab">
		<div @click="changeTab('introduce')">
			商品介绍
		</div>
		<div @click="changeTab('evaluation')">
			商品评价
		</div>
		<div :class="['detail-tab-active-line',{'evaluation-active':isComponent==='evaluation'}]"></div>
	</div>
</template>

<script>
	export default {
		name: "ChooseTab",
		props: {
			isComponent: {
				type: String,
				required: true,
				validator: function (value) {
					return value === 'introduce' || value === 'evaluation';
				}
			}
		},
		methods: {
			changeTab(value) {
				this.$emit('changeTab', value);
			}
		}
	}
</script>
